Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for data sources with heterogeneous cell reuse identifiers #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rafaelwinter
Copy link

This PR has a solution for the case of an implementation that uses more than one reuse identifier on the data source. This happens when the view is composed by heterogeneous cells.

The idea is to use a block that provides the reuse identifier for a cell on the given index path. There are some handy new initializers for this case, that will take the reuse identifier block instead of a single reuse identifier string.

@VitorRodrigues
Copy link

LGTM

👍 LGTM

@gonzalezreal
Copy link
Owner

@rafaelwinter Looks good! My only suggestion would be to implement
-initWithCellReuseIdentifier:configureCellBlock: using
-initWithReuseIdentifierBlock:configureCellBlock: and make the latter the designated initializer.

@@ -36,7 +36,7 @@
Initializes the data source.

@param items The items managed by the data source.
@param reuseIdentifier The cell reuse identifier.
@param reuseIdentifier The default cell reuse identifier.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants